package com.varian.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.varian.tool.Func;
import com.varian.tool.enums.BaseEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author ben
 * @since 2024/8/27
 */
@Getter
@RequiredArgsConstructor
public enum NoticeReceiveTypeEnum implements BaseEnum<NoticeReceiveTypeEnum> {

    // 所有用户
    ALL(0),
    // 指定用户
    USER(1);

    @JsonValue
    @EnumValue
    final Integer value;


    @Override
    public NoticeReceiveTypeEnum convert(Integer value) {
        return Func.findBaseEnumByValue(values(), value);
    }
}
